# -*- coding: UTF-8 -*-
from tools.Request_General import BaseAPI


class Menu(BaseAPI):
    """
    菜单组件相关接口
    """
    def app_create_rear(self, payload):
        """创建应用后置通知"""
        r = self.request_send(json=payload)
        return r

    def module_register_rear(self, payload):
        """组件注册后置通知"""
        r = self.request_send(json=payload)
        return r

    def element_list(self, par):
        """查询元素实例"""
        r = self.request_send(params=par)
        return r

    def element_permissions(self, payload):
        """获取菜单项权限"""
        r = self.request_send(json=payload)
        return r

    def left_list(self, par):
        """查询左侧菜单"""
        r = self.request_send(params=par)
        return r

    def menu_list(self, par):
        """
        查询菜单信息列表
        """
        r = self.request_send(params=par)
        return r

    def save_menu(self, payload):
        """
        菜单保存
        """
        r = self.request_send(json=payload)
        return r

    def delete_menu(self, payload):
        """
        删除菜单元素
        """
        r = self.request_send(json=payload)
        return r

    def menu_manage_list(self, payload):
        """
        查询菜单管理界面信息列表
        """
        r = self.request_send(json=payload)
        return r

    def save_menu_batch(self, payload):
        """
        菜单元素批量保存
        """
        r = self.request_send(json=payload)
        return r
